-
-
Notifications
You must be signed in to change notification settings - Fork 305
[geegong] WEEK 11 solutions #2295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@DaleStudy 리뷰해줘 |
|
이 PR은 여러 문제에 대한 깔끔한 솔루션을 제시했고, 각각의 코드도 가독성이 좋으며 구조화가 잘 되어 있습니다. 특히, 그래프 위상 정렬, 문자열 검색, 최적화된 수열 문제 등 다양한 알고리즘을 잘 적용하셨네요. 다음은 몇 가지 개선 및 격려 포인트입니다:
전반적으로 코드 품질이 높고, 다양한 알고리즘을 잘 활용하셨습니다. 앞으로도 이렇게 구조화된 문제 해결 방식을 계속 유지하고, 주석과 복잡도 표기를 통해 문서화도 신경 쓰시면 더욱 훌륭한 리포지토리 될 것 같습니다. 고생 많으셨고, 계속해서 좋은 문제 풀이 기대하겠습니다! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다! 코멘트 몇 개 남겼습니다. PR 설명에는 1문제 푸셨다고 하셨는데 실제로는 4문제 푸신 것 같네요. 업데이트해주시면 좋을 것 같습니다.
course-schedule/Geegong.java
Outdated
| public boolean canFinish(int numCourses, int[][] prerequisites) { | ||
|
|
||
| int[] indegreeCnt = new int[numCourses]; | ||
| Arrays.fill(indegreeCnt, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정수 배열은 기본값은 0이니 불필요한 줄인 것 같습니다.
course-schedule/Geegong.java
Outdated
|
|
||
|
|
||
| int currentTakenCnt = 0; | ||
| while(queue.iterator().hasNext()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 AI 코치의 의견에 동의하는 바입니다.
| while(queue.iterator().hasNext()) { | |
| while(!queue.isEmpty()) { |
course-schedule/Geegong.java
Outdated
| for (int idx=0; idx<targets.size(); idx++) { | ||
| int course = targets.get(idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요렇게 for 루프를 작성하셨으면 더 깔끔했을 것 같다는 생각이 들었습니다.
| for (int idx=0; idx<targets.size(); idx++) { | |
| int course = targets.get(idx); | |
| for (int course : targets) { |
|
|
||
| public class Geegong { | ||
|
|
||
| /** | ||
| * case 1. Letter 라는 클래스 안에 각 char 를 가지고 있고 하나씩 순회하면서 search 를 하니 응답속도가 너무 느림.. | ||
| * 이전 기수와는 다르게 배열을 활용해서 문제 풀이 | ||
| * time complexity : O(N^2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시간 복잡도 분석이 정확한지 다시 한 번 확인해보시면 좋을 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
꼼꼼한 리뷰 감사드립니다 👍
그런데 저.. 궁금한것이 시간복잡도가 O(26^N) 이라고 하는게 맞는지 사실 잘 확신이 안듭니다 ㅎㅎ
"." 이 있을때마다 26개 문자열에 대해서 계속 뻗어나가니 맞을것 같긴한데..🤔 코딩 테스트에서의 시간 복잡도를 최적의 케이스와 최악의 케이스로 나눠서 얘기해도 되는지 궁금하긴 하네요ㅎㅎ;
merge-intervals/Geegong.java
Outdated
| int[] last = result.get(result.size() - 1); | ||
| int[] newThing = new int[]{last[0], Math.max(last[1], current[1])} ; | ||
| result.remove(result.size() - 1); | ||
| result.add(result.size() - 1, newThing); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 리트코드에 제출해보셨나요? 이 부분에서 제거 후 리스트가 비었을 경우 -1 인덱스가 되어 오류가 발생할 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 이런;; 해당 코드를 처음에 작성했던 코드고 오류가 있어서 리트코드에서 다시 풀었는데 해당 파일에는 업데이트를 하지 않았네요ㅠㅠ 예리한 지적 감사합니다 🙏
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!